home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-MIPS / CURRENT.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  793b  |  36 lines

  1. /* $Id: current.h,v 1.4 1998/07/20 17:52:19 ralf Exp $
  2.  *
  3.  * This file is subject to the terms and conditions of the GNU General Public
  4.  * License.  See the file "COPYING" in the main directory of this archive
  5.  * for more details.
  6.  *
  7.  * Copyright (C) 1998 Ralf Baechle
  8.  */
  9. #ifndef __ASM_MIPS_CURRENT_H
  10. #define __ASM_MIPS_CURRENT_H
  11.  
  12. #ifdef _LANGUAGE_C
  13.  
  14. /* MIPS rules... */
  15. register struct task_struct *current asm("$28");
  16.  
  17. #endif /* _LANGUAGE_C */
  18. #ifdef _LANGUAGE_ASSEMBLY
  19.  
  20. /*
  21.  * Special variant for use by exception handlers when the stack pointer
  22.  * is not loaded.
  23.  */
  24. #define _GET_CURRENT(reg)            \
  25.     lui    reg, %hi(kernelsp);        \
  26.     .set    push;                \
  27.     .set    noreorder;            \
  28.     lw    reg, %lo(kernelsp)(reg);    \
  29.     .set    pop;                \
  30.     ori    reg, 8191;            \
  31.     xori    reg, 8191
  32.  
  33. #endif
  34.  
  35. #endif /* __ASM_MIPS_CURRENT_H */
  36.